package god;

import java.util.Scanner;

public class J12Retangle {
	public static void main(String[] args) {
		
		Retangles re = new Retangles();
		re.getWidth( re.makeScanner() );
		re.getHeight( re.makeScanner() );
		System.out.println( re.getArea(re.width, re.height) );
		System.out.println( re.getPerimeter(re.width, re.height) );
	}

}

class Retangles {
	double width, height;
	final static double PI = 3.14;
	
	public Scanner makeScanner() {
		Scanner sc = new Scanner(System.in);
		return sc;
	}
	
	public void closeScanner(Scanner sc) {
		sc.close();
	}
	
	public double getWidth(Scanner sc) {
		System.out.println("가로를 입력해주세요.");
		width = sc.nextInt();
		return width;
	}
	
	public double getHeight(Scanner sc) {
		System.out.println("세로를 입력해주세요.");
		height = sc.nextInt();
		closeScanner(sc);
		return height;
	}
	
	public double getArea(double width, double height) {
		return width * height;
	}
	
	public double getPerimeter(double width, double height) {
		return (width + height) * 2;
	}
}